﻿<Window xmlns:my1="clr-namespace:WPFPropertyGrid.Controls;assembly=WPFPropertyGrid"  xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"  x:Class="WPFDBBrowser.Windows.ConnectionEdit"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="ConnectionEdit" WindowStyle="ToolWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="203" d:DesignWidth="392" SizeToContent="WidthAndHeight">
    <Window.Resources>
        <!--<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Themes/PropertyGrid.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>-->
        <Style TargetType="{x:Type Label}">
            <Setter Property="HorizontalAlignment" Value="Right"></Setter>
            <Setter Property="VerticalAlignment" Value="Center"></Setter>
        </Style>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Height" Value="25"></Setter>
        </Style>
        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="Height" Value="25"></Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <Label Content="Type:" Height="25" ></Label>
        <ComboBox VerticalAlignment="Stretch" Margin="5" Grid.Column="1" Name="comboBoxTypes" SelectedValuePath="Name"
                  DisplayMemberPath="FriendlyName" SelectedValue="{Binding Path=Type, Mode=TwoWay}"></ComboBox>
        <Label Content="Name:" Height="25" Grid.Row="1"></Label>
        <TextBox VerticalAlignment="Stretch" Margin="5" Grid.Row="1" Grid.Column="1" Name="txtName"
                 Text="{Binding Path=Name, Mode=TwoWay}"></TextBox>
        <Label Content="Connection string:" Height="25" Grid.Row="2" VerticalAlignment="Top"></Label>
        <TextBox VerticalAlignment="Stretch" Height="50" Margin="5" Grid.Row="2" Grid.Column="1"
                 Name="txtConnectionString" Width="250" TextWrapping="Wrap" Text="{Binding Path=ConnectionString, Mode=TwoWay}"></TextBox>
        <Grid Grid.Row="3" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Button Content="Test" Margin="5" HorizontalAlignment="Center" Name="btnTest"></Button>
            <Button Content="OK" Margin="5" IsDefault="True" Grid.Column="2" HorizontalAlignment="Center" Click="btnOKClick"></Button>
            <Button Content="Cancel" Margin="5" IsCancel="True" Grid.Column="3" HorizontalAlignment="Center" Click="btnCancelClick"></Button>
        </Grid>
    </Grid>
</Window>
